clear all
use Compustat_Comparison

STOP STOP STOP
************************************************************
************************************************************

reg ltotal_spend lrev  
reg ltotal_spend lrev if avg_ratio>.0001 & avg_ratio<.05
reg ltotal_spend lrev if avg_ratio>.001 & avg_ratio<.03
reg ltotal_spend lrev if avg_ratio>.001 & avg_ratio<.03, ab(period)
twoway (sc ltotal_spend lrev )(lfit ltotal_spend lrev) if ltotal_spend>10, graphregion(fcolor(white)) xtitle("ln(Compustat Revenue)", size(large)) ytitle("ln(Total Observed Spending)", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large)) xlabel(17(2)25)
graph export compustat_data_provider_levels.png, replace

reg d_ltotal_spend d_lrev  , ab(period)
reg d_ltotal_spend d_lrev if avg_ratio>.0001 & avg_ratio<.05
reg d_ltotal_spend d_lrev if avg_ratio>.001 & avg_ratio<.03
reg d_ltotal_spend d_lrev if avg_ratio>.001 & avg_ratio<.03, ab(period)
twoway (sc d_ltotal_spend d_lrev)(lfit d_ltotal_spend d_lrev ) if avg_ratio>.001 & avg_ratio<.03 & abs(d_lrev)<1, graphregion(fcolor(white)) xtitle("D.ln(Compustat Revenue)", size(large)) ytitle("D.ln(Total Observed Spending)", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export compustat_data_provider_changes.png, replace

************************************************************
************************************************************

reg ltotal_spend lrev
binscatter ltotal_spend lrev, by(retail)
binscatter ltotal_spend lrev, xtitle("ln(Compustat Revenue)", size(large)) ytitle("ln(Total Observed Spending)", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large)) xlabel(17(2)24)
graph export compustat_data_provider_levels_bins.png, replace
 
reg d_ltotal_spend d_lrev
binscatter d_ltotal_spend d_lrev, by(retail)
binscatter d_ltotal_spend d_lrev, xtitle("D.ln(Compustat Revenue)", size(large)) ytitle("D.ln(Total Observed Spending)", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large)) xlabel(-.5(.2).5)
graph export compustat_data_provider_changes_bins.png, replace

